<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>H+ 后台主题UI框架 - 空白页</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="favicon.ico"> <link href="__STATIC__/layout/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__STATIC__/layout/css/font-awesome.css?v=4.4.0" rel="stylesheet">
     <!-- jqgrid-->
    <link href="__STATIC__/layout/css/plugins/jqgrid/ui.jqgrid.css?0820" rel="stylesheet">
    <link href="__STATIC__/layout/css/animate.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="__STATIC__/layout/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/gyq.css" rel="stylesheet">
    <link rel="stylesheet" href="__STATIC__/layout/css/demo.css" type="text/css">
    <link rel="stylesheet" href="__STATIC__/layout/css/zTreeStyle.css" type="text/css">
     <script src="__STATIC__/layout/js/jquery.min.js?v=2.1.4"></script>
    <script src="__STATIC__/sc/js/page.js"></script> 
    <style>
    #pagesize{height:23px;}
     body form div select.form-control{padding: 2px 12px;}
    </style>
</head>

<body style="color:#333;padding:3px;">
    <!-- 标题 -->
    <div class="page-heade">
       <h2 class="title_color text-center">AP预算费用统计查询</h2>
    </div>
    <!-- 标题 -->

    <!-- 筛选 -->
    <form class="form-inline table text-center formpage" method="post" id="form_check">
     					<input type="hidden" value='{$page}' name="page" id="page-go"/>
                      <input type="hidden" value='{$list}' name="list" id="list-go"/>
      <div class="form-group margin-10">
        <label for="exampleInputName2">经销商：</label>
        <select class="form-control" name="fenqu" id="fenqu">
          <option value="0">请选择分区</option>
          {volist name="fenqu" id="vof"}
          	{if condition="$vof.id eq $data.fenqu"}
          	<option value="{$vof.id}"  selected>{$vof.title}</option>
          	{else/}
          	<option value="{$vof.id}" >{$vof.title}</option>
          	{/if}
          {/volist}
        </select>
        <select class="form-control" name="sheng" id="sheng">
          <option value="0">请选择省份</option>
         
        </select>
        <select class="form-control" name="shi" id="shi">
          <option value="0">请选择城市</option>
          
        </select>
        <select class="form-control" name="jingxiao" id="jingxiao">
          <option value="0">请选择经销商</option>
         
        </select>
      </div>
      <div class="form-group margin-10">
        <label for="exampleInputEmail2">品牌：</label>
        <select class="form-control" name="pinpai" id="pinpai">
          <option value="0">请选择品牌</option>
          {volist name="pinpai" id="vop"}
          	{if condition="$data.pinpai eq $vop.id"}
          	<option value="{$vop.id}" selected>{$vop.brand_name}</option>
          	{else/}
          	<option value="{$vop.id}">{$vop.brand_name}</option>
          	{/if}
          {/volist}
        </select>
      </div>
      <div class="form-group margin-10">
        <label for="exampleInputEmail2">二级费用科目：</label>
       <select class="form-control" name="yijifeiyong" id="yijifeiyong">
                  <option value="0">请选择一级科目</option>
                 {volist name="yijifeiyong" id="voyi"}
              {if condition="$data.yijifeiyong eq $voyi.id"}
                <option value="{$voyi.id}" selected>{$voyi.title}</option>
              {else/}
                <option value="{$voyi.id}">{$voyi.title}</option>
              {/if}
                 {/volist}
                </select>
        <select class="form-control" name="erjifeiyong" id="erjifeiyong">
          <option value="0">请选择二级科目</option>
          
        </select>
      </div>
       <div class="form-group margin-10">
        <label for="exampleInputEmail2">一级渠道：</label>
        <select class="form-control" name="channel1">
          <option value="0">请选择一级渠道</option>
			{volist name="qudao" id="voqd"}
				{if condition="$data.channel1 eq $voqd.id"}
				<option value="{$voqd.id}" selected>{$voqd.title}</option>
				{else/}
				<option value="{$voqd.id}">{$voqd.title}</option>
				{/if}
			{/volist}
        </select>
      </div>
      <div class="form-group margin-10">
        <label for="exampleInputEmail2">二级考核期：</label>
         <select class="form-control" name="cainian" id="cainian">
          <option value="0">请选择财年</option>
          {volist name="cainian" id="voc"}
            {if condition="$data.cainian eq $voc.id"}
            <option value="{$voc.id}" selected>{$voc.title}</option>
            {else/}
            <option value="{$voc.id}">{$voc.title}</option>
            {/if}
          {/volist}
        </select>
         <select class="form-control" name="yijikaoheqi" id="yijikaoheqi">
          <option value="0">请选择一级考核期</option>
        
        </select>
        <select class="form-control" name="erjikaoheqi" id="erjikaoheqi">
          <option value="0">请选择二级考核期</option>
         
        </select>
      </div>
      <div class="container-fluid margin-10">
       
        <input type="button" value="查询" class='btn btn-outline btn-primary' id="check"/>
        <input type="button" value="清空查询条件" class='btn btn-outline btn-warning' id="clear_check"/>
             <input type="button" value="导出数据" class='btn btn-outline btn-success'/>
      </div>
    </form>
    <!-- 筛选 -->

    <!-- 表格 -->
    <div class="col-md-12 no-padding"  style="padding: 0 12px;">
    {if condition="$sum neq 0"}
        <table class="table table-hover table-bordered table-striped text-center bud_hei">
          <tr class="info">
            <th class="text-center">一级渠道</th>
            <th class="text-center">分区</th>
            <th class="text-center">省份</th>
            <th class="text-center">城市</th>
            <th class="text-center">经销商</th>
            <th class="text-center">产品品牌</th>
            <th class="text-center">一级费用科目</th>
            <th class="text-center">二级费用科目</th>
            <th class="text-center">财年</th>
            <th class="text-center">一级考核期</th>
            <th class="text-center">二级考核期</th>
            <th class="text-center">预算金额(元)</th>
          </tr>
          {volist name="apply" id="vo"}
 			<tr>
            <td>{$vo.channel1}</td>
            <td>{$vo.fenqu}</td>
            <td>{$vo.sheng}</td>
            <td>{$vo.shi}</td>
            <td>{$vo.jingxiao}</td>
            <td>{$vo.pinpai}</td>
            <td>{$vo.yijifeiyong}</td>
            <td>{$vo.erjifeiyong}</td>
            <td>{$vo.cainian}</td>
            <td>{$vo.yijikaoheqi}</td>
            <td>{$vo.erjikaoheqi}</td>
            <td>{$vo.feiyong}</td>
          </tr>

          {/volist}
         
        </table>
        <h5 class="text-center" id="pagesc" style="font-size: 16px;font-weight: 500">
            <script>
                            $(function(){
                                pageSC("pagesc",{$sum},{$page},{$maxpage})
                            })
                        </script> 
          每页显示
          <select id="pagesize">
           
            <option value='20'{if condition="$list eq 20"}selected{/if}>20条</option>
			<option value='40'{if condition="$list eq 40"}selected{/if}>40条</option>
			<option value='50'{if condition="$list eq 50"}selected{/if}>50条</option>
          </select>
        </h5>
        {else/}
        <h3 class="text-center">对不起没有查询到符合条件的信息</h3>
    		{/if}
      </div>
    <!-- 表格 -->
    <div>

    </div>
  
        
    </div>
    
    <!-- 全局js -->
    <script src="__STATIC__/layout/js/bootstrap.min.js?v=3.3.6"></script>
    <!-- <script src="js/plugins/metisMenu/jquery.metisMenu.js"></script> -->
    <script src="__STATIC__/layout/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
    <!-- <script src="js/plugins/layer/layer.min.js"></script> -->

  
    <script src="__STATIC__/layout/js/content.js?v=1.0.0"></script>
     <script src="__STATIC__/layout/js/plugins/sweetalert/sweetalert.min.js"></script>
    
    <!-- ztree -->
    <script type="text/javascript" src="__STATIC__/layout/js/jquery.ztree.core.js"></script>
    <script type="text/javascript" src="__STATIC__/layout/js/jquery.ztree.excheck.js"></script>
    <!-- <script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script> -->
    <!--统计代码，可删除-->
    <script src="__STATIC__/layout/js/plugins/layer/laydate/laydate.js"></script>
    <script>
  //翻页
      
        $("#check").click(function(){
              $("#page-go").val(1);
              $(".formpage").submit();
        })
        $("#clear_check").click(function(){
            $("input[type='text']").val("");
            $("#page-go").val(1);
            
            $("select").val(0);
          
            $(".formpage").submit();
        })

         var kaohe1json='{$jsonkaohe1}';
        var kaohe1arr=JSON.parse(kaohe1json);
        var kaohe2json='{$jsonkaohe2}';
        var kaohe2arr=JSON.parse(kaohe2json);
        var jsonerjifeiyong='{$jsonerjifeiyong}';
        var feiyong2arr=JSON.parse(jsonerjifeiyong)


        var jsonsheng='{$jsonsheng}';
        var shengarr=JSON.parse(jsonsheng)
        var jsonshi='{$jsonshi}';
        var shiarr=JSON.parse(jsonshi)
        var jsonjingxiao='{$jsonjingxiao}';
        var jingxiaoarr=JSON.parse(jsonjingxiao)
           {if $data.yijifeiyong}
            erfeixy();

            {/if}
            {if $data.erjifeiyong}
            $("#erjifeiyong").val({$data.erjifeiyong})

            {/if}
            {if $data.cainian}
            yikaoxy();
            {/if}
            {if $data.yijikaoheqi}
            $("#yijikaoheqi").val({$data.yijikaoheqi})
            erkaoxy();
            {/if}
            {if $data.erjikaoheqi}
               $("#erjikaoheqi").val({$data.erjikaoheqi})
            {/if}
            {if $data.fenqu}
              $("#fenqu").val({$data.fenqu})
              shengxy();
            {/if}
            {if $data.sheng}
              $("#sheng").val({$data.sheng})
              shixy();
            {/if}
            {if $data.shi}
              $("#shi").val({$data.shi})
              jingxiaoxy();
            {/if}
            {if $data.jingxiao}
              $("#jingxiao").val({$data.jingxiao})
            {/if}
        $(function(){

        	
        	$("#cainian").change(function(){
            
            yikaoxy();
            erkaoxy();
            
          })
          $("#yijikaoheqi").change(function(){
            
            erkaoxy();
          })
          $("#yijifeiyong").change(function(){
            
            erfeixy();
          })
        	$("#fenqu").change(function(){
        		
        		shengxy();
        		
        		shixy();
        		
        		jingxiaoxy();
        	})
        	$("#sheng").change(function(){
        		
        		shixy();
        		
        		jingxiaoxy();
        	})
        	$("#shi").change(function(){
        		
        		jingxiaoxy();
        	})
        })
      //一级考核期显示隐藏
      function yikaoxy(){
        $("#yijikaoheqi").html('<option value="0">请选择一级考核期</option>')
        for(var i=0;i<kaohe1arr.length;i++){
          if(kaohe1arr[i]["cainian"]==$("#cainian").val()){
            $("#yijikaoheqi").append('<option value="'+kaohe1arr[i]["id"]+'">'+kaohe1arr[i]["title"]+'</option>')
          }
        }
        erkaoxy();
      }
      //二级考核期显示隐藏
       function erkaoxy(){
         $("#erjikaoheqi").html('<option value="0">请选择二级考核期</option>')
         for(var i=0;i<kaohe2arr.length;i++){
          if(kaohe2arr[i]["yijikaoheqi"]==$("#yijikaoheqi").val()){
            $("#erjikaoheqi").append('<option value="'+kaohe2arr[i]["id"]+'">'+kaohe2arr[i]["title"]+'</option>')
          }
        }
      }
      //二级费用科目显示隐藏
      function erfeixy(){
        //feiyong2arr
        $("#erjifeiyong").html('<option value="0">请选择二级科目</option>')
        for(var i=0;i<feiyong2arr.length;i++){
          if(feiyong2arr[i]["yijifeiyong"]==$("#yijifeiyong").val()){
            $("#erjifeiyong").append('<option value="'+feiyong2arr[i]["id"]+'">'+feiyong2arr[i]["title"]+'</option>')
          }
        }
      }
      //省显示隐藏
      function shengxy(){
      	$("#sheng").html("<option value='0'>请选择省份</option>")
        for(var i=0;i<shengarr.length;i++){
          if(shengarr[i]["fenqu"]==$("#fenqu").val()){
            $("#sheng").append('<option value="'+shengarr[i]["id"]+'">'+shengarr[i]["title"]+'</option>')
          }
        }
      }
      //市显示隐藏
      function shixy(){
      	$("#shi").html("<option value='0'>请选择城市</option>")
        for(var i=0;i<shiarr.length;i++){
          if(shiarr[i]["sheng"]==$("#sheng").val()){
            $("#shi").append('<option value="'+shiarr[i]["id"]+'">'+shiarr[i]["title"]+'</option>')
          }
        }
      }
      //经销商
      function jingxiaoxy(){
      	$("#jingxiao").html("<option value='0'>请选择经销商</option>")
        for(var i=0;i<jingxiaoarr.length;i++){
          if(jingxiaoarr[i]["shi"]==$("#shi").val()){
            $("#jingxiao").append('<option value="'+jingxiaoarr[i]["id"]+'">'+jingxiaoarr[i]["title"]+'</option>')
          }
        }
      }
    </script>
</body>

</html>
